﻿#include <QObject>
#include <QDebug>
#include <QPushButton>
#include <QGraphicsProxyWidget>
#include "diceroller.h"
#include "dicebag.h"
#include "dicemat.h"

DiceRoller::DiceRoller() : QGraphicsScene()
{
    setSceneRect(0.0, 0.0, 400.0, 240.0);

    DiceMat* diceMat = new DiceMat(40.0, -100.0);
    addItem(diceMat);

    DiceBag* diceBag = new DiceBag(-180.0, -100.0, diceMat);
    addItem(diceBag);

    QPushButton* rollButton = new QPushButton("Roll");
    QGraphicsProxyWidget* proxyWidget = addWidget(rollButton);
    proxyWidget->setPos(QPointF(-180.0, 300.0));

    QObject::connect(rollButton, SIGNAL(clicked()), this, SLOT(roll()));
}

void
DiceRoller::roll()
{
    qDebug() << __PRETTY_FUNCTION__;
}

